/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

 

package com.sui.bigdata.flink.sql.core.side;

import com.sui.bigdata.flink.sql.core.table.AbsTableParser;
import com.sui.bigdata.flink.sql.core.util.PluginUtil;
import com.sui.bigdata.flink.sql.side.hbase.table.HbaseSideParser;
import com.sui.bigdata.flink.sql.side.kudu.table.KuduSideParser;
import com.sui.bigdata.flink.sql.side.mysql.MysqlSideParser;
import com.sui.bigdata.flink.sql.sink.kudu.table.KuduSinkParser;


/**
 * get specify side parser
 * Date: 2019/07/10
 * @author yong_chen@sui.com
 */

public class StreamSideFactory {

    private static final String CURR_TYPE = "side";

    private static final String HBASE = "hbase";

    private static final String MYSQL = "mysql";

    private static final String KUDU = "kudu";

    public static AbsTableParser getSqlParser(String pluginType, String cacheType) throws Exception {
        switch (pluginType){
            case HBASE:
                return new HbaseSideParser();
            case MYSQL:
                return new MysqlSideParser();
            case KUDU:
                return new KuduSideParser();
            default:
                throw new RuntimeException(" not support this side now ");
        }
    }

    public static void main(String[] args) throws Exception{
        System.out.println(PluginUtil.getSideJarFileDirPath("", "", "target", "E:\\fd-flink"));
    }
}
